import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index',
    children:[
      {
        path:"/detail",
        component:() => import('../views/home/DetailView.vue')
      },
      {
        path:"/index",
        component:() => import('../views/home/IndexView.vue'),
        children: [
          {
            path: '/banner',
            component:() => import('../views/home/banner/IndexBannerView.vue')
          }
        ]
      },
      {
        path:"/workers",
        component:() => import('../views/home/student-dev/WorkersView.vue')
      },
      {
        path:"/logistics",
        component:() => import('../views/home/LogisticsView.vue')
      },
      {
        path:"/factory",
        component:() => import('../views/home/FactoryView.vue')
      },
      {
        path:'/login',
        component:()=>import('../views/home/LoginView.vue')
      },
      {
        path: '/reg',
        component:()=>import('../views/home/RegView.vue')
      },
      {
        path:'/lookWork',
        component:()=>import('../views/home/student-dev/LookWorkView.vue'),
        redirect: '/lookWork/recruitcard',
        children: [
          {
            path:'recruitcard',
            component:()=>import('../views/home/lookwork/LookWorkRecruitCardView.vue')
          }
        ]
      },
      {
        path:'/member',
        component:()=>import('../views/home/MemberView.vue'),
        redirect:'/member/personinfo',
        children:[
          {
            path:"personinfo",
            component:()=>import('../views/home/member/MemberPersonInfoView.vue')
          },
          {
            path:"authentica",
            component:()=>import('../views/home/member/MemberAuthenticaManageView.vue')
          },
          {
            path:"consum",
            component:()=>import('../views/home/member/MemberConsumRecordsView.vue')
          },
          {
            path:"earnpoints",
            component:()=>import('../views/home/member/MemberEarnPointsView.vue')
          },
          {
            path:"managerecit",
            component:()=>import('../views/home/member/MemberManageRecuitView.vue')
          },
          {
            path:"managetrade",
            component:()=>import('../views/home/member/MemberManageTradeView.vue')
          },
          {
            path:"myview",
            component:()=>import('../views/home/member/MemberMyView.vue')
          },
          {
            path:"releaseperson",
            component:()=>import('../views/home/student-dev/MemberReleasePersonInfoView.vue')
          },
          {
            path:"releaserecuit",
            component:()=>import('../views/home/student-dev/MemberReleaseRecuitInfoView.vue')
          },
          {
            path:"releasetrade",
            component:()=>import('../views/home/member/MemberReleaseTradeView.vue')
          },
          {
            path:"entermanage",
            component:()=>import('../views/home/member/MemberEnterpriseManageView.vue')
          },
          {
            path:'alterpersoninfo',
            component:()=>import('../views/home/member/MemberPersonInfoAlterView.vue')
          },
        ]
      },
      {
        path: '/text',
        component:()=>import('../views/home/TextView.vue')
      }
    ]
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
